<template>
<div>
  <div id="condition">
    <span>时间选择</span>
    <datapicker @event="receivefrom"></datapicker>
    <el-button type="primary" @click="searchinfo">查询</el-button>
  </div>
       <!--展示数据区域-->
  <el-table
  :data="tableList"
  border
  style="width: 100%">
      <!--展示数据姓名行区域-->
    <el-table-column
    prop="insert_time"
    label="时间" >
    </el-table-column>
    <el-table-column
    prop="tbl_id"
    label="编号" >
    </el-table-column>
    <el-table-column
    prop="tbl_name"
    label="姓名" >
    </el-table-column>
  </el-table>
</div>
</template>
<style scoped>
#condition{
  display: flex;
  justify-content: left;
  align-items: center;
}
.el-button{
  margin-left: 10px;
}
span{
  padding: 10px;
}
.el-table{
  margin-top: 50px;
}
</style>
<script>
import datapicker from './datapicker'
import axios from 'axios'
export default{
  data(){
    return{
      tableList:[],
      pickdatatime:''
    }
  },
  methods:{
    receivefrom(pickdata){
      this.pickdatatime=pickdata
      console.log(this.pickdatatime)
    },
    searchinfo(){
      axios.get('/datas',{params:this.pickdatatime}).then(res=>{
      this.tableList=res.data.data
      console.log(this.tableList)
      console.log(res.data)
    })
    }
  },
  components:{
      datapicker
    }
}
</script>